package com.prs.crm.dao.oa.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.oa.VehicleApplicationsDao;
import com.prs.crm.domain.oa.Vehicle;
import com.prs.crm.domain.oa.VehicleApplications;

public class VehicleApplicationsDaoImpl extends BaseDaoImpl<VehicleApplications> implements VehicleApplicationsDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<VehicleApplications> getAllvechicleApplications() {
		return (List<VehicleApplications>) this.getHibernateTemplate().execute(new HibernateCallback() {
			public Object doInHibernate(Session session)
					throws HibernateException, SQLException {
				Criteria criteria=session.createCriteria(VehicleApplications.class);
				return  criteria.list();
			}
		});
	}

}
